﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SlideShow.aspx.cs" Inherits="ShopOnline.Admin.SlideShow"
    MasterPageFile="~/AdminMaster.master" Theme="ShopOnline" %>

<asp:Content runat="server" ID="cSlideShow" ContentPlaceHolderID="ContentPlaceHolder1">
    <div align="right" style="padding:5px">
        <a href="UpdateSlideShow.aspx">
            <button id="btnAddPick" type="button" title="Add Pick" class="button">
                <span><span>Add Pick</span></span></button></a></div>
    <asp:GridView ID="gvSlideShow" runat="server" AutoGenerateColumns="false" 
        HeaderStyle-Font-Bold="true" RowStyle-Height="30px" HeaderStyle-Height="30px"
        GridLines="Horizontal" Width="100%" ShowHeader="true" CellPadding="5"
        CellSpacing="5" CssClass="grid" RowStyle-CssClass="row" 
        HeaderStyle-CssClass="head" onrowcommand="gvSlideShow_RowCommand"
        >
        <Columns>
            <asp:BoundField HeaderText="Slot" DataField="Slot" ShowHeader="true" ItemStyle-Width="5%" />
            <asp:TemplateField HeaderText="Publish On" ItemStyle-Width="10%">
                <ItemTemplate>
                    <%# Convert.ToBoolean(Eval("ShowAlways"))? "Always" : Convert.ToDateTime(Eval("StartDate")).ToString("HH:MM dd-MMM-yyyy") %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Discard On" ItemStyle-Width="10%">
                <ItemTemplate>
                    <%# Convert.ToBoolean(Eval("ShowAlways"))? "Never" : Convert.ToDateTime(Eval("EndDate")).ToString("HH:MM dd-MMM-yyyy") %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="Title" DataField="Title" ItemStyle-Width="30%"/>
            <asp:TemplateField HeaderText="Description" ItemStyle-Width="40%">
                <ItemTemplate>
                    <%# ShopOnline.Utilities.GetSubString(Eval("Description").ToString(), 50) %> ...
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Action" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <div align="center">
                        <asp:LinkButton runat="server" ID="imbRemove" Text="Remove" CommandName="Remove" OnClientClick="return confirm('Do you want to delete this item?');" CommandArgument='<%# Eval("ID") %>'></asp:LinkButton>
                        <a href="UpdateSlideShow.aspx?id=<%# Eval("ID") %>">Edit</a>
                    </div>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</asp:Content>
